package com.atguigu.com.exam;

/**
 * @author xbd
 * @create 2021-05-23 11:57
 */

class Threads extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            if (i % 2 == 0) {
                System.out.println(Thread.currentThread().getName() + ":输出：" +i);
            }
        }
    }
}

class ThreadImp implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            if (i % 2 != 0) {
                System.out.println(Thread.currentThread().getName() + ":输出：" +i);
            }
        }
    }
}

public class ThreadTest {
    public static void main(String[] args) {
        Threads t1 = new Threads();
        t1.start();

        ThreadImp imp = new ThreadImp();
        Thread ts = new Thread(imp);
        ts.start();
    }
}
